package handlers;

import main.MainMap;
import constants.Exptable;
import people.Character;

public class GainExperience {

	public static void handle(Character c, int gain) {
		System.out.println("You have gained " + gain + " experience");
		System.out.println("");
		if (c.exp + gain >= Exptable.exp[c.level - 1]) {
			LevelUpHandler.handle(c);
		} else {
			c.exp = c.exp + gain;
		}
		MainMap.stats.recalcStats();
	}
}
